package com.example.love_margin.Untils;

import java.util.Date;

public class FileNameUtils {

    /**
     * 获取文件后缀
     * @param fileName
     * @return
     */
    public static String getSuffix(String fileName){
        return fileName.substring(fileName.lastIndexOf("."));
    }

    /**
     * 生成新的文件名
     * @param fileOriginName 源文件名
     * @return
     */
    public static String getFileName(String fileOriginName){
        System.out.println(fileOriginName+"ad");
        Date date = new Date();

//        String fileName = date.getTime()+fileOriginName;
        return UUIDUtils.getUUID() + FileNameUtils.getSuffix(fileOriginName);
//        return fileName;
    }

}
